package com.lanca.controller;

import com.lanca.dto.DbServiceKitVo;
import com.lanca.dto.DdOrgVo;
import com.lanca.vo.ResultVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.Arrays;
import java.util.List;

@RestController
public class ProductController {

    private static final Logger log = LoggerFactory.getLogger(ProductController.class);

    @Value("${server.port}")
    private String port;

    @PostMapping("/product")
    public ResultVo product() {
        log.info("调用product服务 id={}", 12);
        DbServiceKitVo dbServiceKitVo = new DbServiceKitVo();
        dbServiceKitVo.setA(12);
        List<String> areaIds = Arrays.asList("abcd", "fffa", "cccsrad");
        dbServiceKitVo.setStr("otherStr");
        dbServiceKitVo.setAreaIds(areaIds);
        dbServiceKitVo.setDbOrgVo(new DdOrgVo());
        return ResultVo.ok(dbServiceKitVo);
    }
}
